﻿using System;
using UnityEngine;

// Token: 0x020002FA RID: 762
[RequireComponent(typeof(AudioSource))]
internal class SoundEffect : MonoBehaviour
{
	// Token: 0x0600138C RID: 5004 RVA: 0x0008BA90 File Offset: 0x00089C90
	private void Awake()
	{
		this.audio = base.GetComponent<AudioSource>();
	}

	// Token: 0x0600138D RID: 5005 RVA: 0x0008BAA0 File Offset: 0x00089CA0
	private void Update()
	{
		this.audio.volume = ((this.type != SoundEffect.TYPE.TYPE_SE) ? ConfigData.VolumeSyetem() : ConfigData.VolumeSoundEffect());
		if (this.finishSuside && !this.audio.isPlaying)
		{
			UnityEngine.Object.Destroy(base.gameObject);
		}
	}

	// Token: 0x0600138E RID: 5006 RVA: 0x0008BAF8 File Offset: 0x00089CF8
	public void Play()
	{
		this.audio.volume = ((this.type != SoundEffect.TYPE.TYPE_SE) ? ConfigData.VolumeSyetem() : ConfigData.VolumeSoundEffect());
		this.audio.Play();
	}

	// Token: 0x0600138F RID: 5007 RVA: 0x0008BB2C File Offset: 0x00089D2C
	public void Play(AudioClip clip)
	{
		this.audio.clip = clip;
		this.audio.volume = ((this.type != SoundEffect.TYPE.TYPE_SE) ? ConfigData.VolumeSyetem() : ConfigData.VolumeSoundEffect());
		this.audio.Play();
	}

	// Token: 0x04001891 RID: 6289
	private AudioSource audio;

	// Token: 0x04001892 RID: 6290
	public bool finishSuside;

	// Token: 0x04001893 RID: 6291
	public SoundEffect.TYPE type;

	// Token: 0x020002FB RID: 763
	public enum TYPE
	{
		// Token: 0x04001895 RID: 6293
		TYPE_SE,
		// Token: 0x04001896 RID: 6294
		TYPE_SYSTEM
	}
}
